package org.manon.json.custom;

import java.io.IOException;
import java.io.OutputStream;

import junit.framework.Assert;

import org.manon.json.SerializerProvider;
import org.manon.json.filter.Filter;


public final class CustomAssociationChildSerializer extends CustomSerializer<CustomAssociationChild> {

	private final SerializerProvider _provider;
	
	public CustomAssociationChildSerializer(SerializerProvider provider) {
		_provider = provider;
	}

	/**
	 * @see org.manon.json.io.Serializer#serialize(java.io.OutputStream, java.lang.Object, org.manon.json.filter.Filter)
	 */
	public void serialize(OutputStream os, CustomAssociationChild pojo, Filter filter) throws IOException {
		os.write("HELLO WORLD :-)".getBytes());
		Assert.assertEquals(this.getClass(), _provider.getSerialiser(CustomAssociationChild.class).getClass());
	}

}